package IC.lir.instructions;
import IC.lir.operands.Operand;
import IC.lir.operands.RegOperand;
import IC.lir.*;

/**
 * MoveArray instruction (load):
 * 
 * MoveArray Op1, Op2
 * 
 * Op1: Reg[Reg], Reg[Immediate]
 * Op2: Reg
 *
 */
public class MoveFromArrayInstr extends MoveArrayInstr {
	private Operand 	dest;

	/**
	 * Create a MoveArray load instruction
	 * @param array the array operand
	 * @param index the index specifier
	 * @param dest the destination
	 */
	public MoveFromArrayInstr(RegOperand array, Operand index, Operand dest) {
		super(array,index);
		assert(dest instanceof RegOperand);
		this.dest = dest;
	}

	/**
	 * @return the destination
	 */
	public Operand getDest() {
		return dest;
	}

	@Override
	public <D,U> U accept(Visitor<D,U> v, D context) {
		return v.visit(this,context);
	}
}
